﻿@model XData.WebApp.Models.SetInitialPasswordModel

@{
    ViewBag.Title = "Set initial password";
}

<h2>Set initial password for all new users</h2>

<hr />

<form id="form" class="form-horizontal" method="post" role="form"
      data-bv-message="This value is not valid"
      data-bv-feedbackicons-valid="glyphicon glyphicon-ok"
      data-bv-feedbackicons-invalid="glyphicon glyphicon-remove"
      data-bv-feedbackicons-validating="glyphicon glyphicon-refresh">
    <div class="form-group">
        @Html.ValidationSummary(false, null, new { @class = "col-sm-offset-1 text-danger" })
    </div>
    <div class="form-group">
        @Html.LabelFor(m => m.NewPassword, new { @class = "col-sm-2 control-label" })
        <div class="col-sm-4">
            @Html.PasswordFor(m => m.NewPassword,
                new
                {
                    maxlength = "20",
                    @class = "form-control",
                    data_bv_notempty = "true",
                    data_bv_notempty_message = "The new password is required and cannot be empty",
                    data_bv_stringlength = "true",
                    data_bv_stringlength_min = "6",
                    data_bv_stringlength_max = "20",
                    data_bv_stringlength_message = "The new password must be at least 6 and not more than 20 characters long",
                    data_bv_identical = "true",
                    data_bv_identical_field = "ConfirmPassword",
                    data_bv_identical_message = "The new password and its confirm are not the same"
                })
        </div>
    </div>
    <div class="form-group">
        @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-sm-2 control-label" })
        <div class="col-sm-4">
            @Html.PasswordFor(m => m.ConfirmPassword,
                new
                {
                    @class = "form-control",
                    data_bv_notempty = "true",
                    data_bv_notempty_message = "The confirm password is required and cannot be empty",
                    data_bv_identical = "true",
                    data_bv_identical_field = "NewPassword",
                    data_bv_identical_message = "The new password and its confirm are not the same"
                })
        </div>
    </div>
    <div class="form-group">
        <div data-plugin="errorRenderer" class="col-sm-offset-4 text-danger">
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-4">
            <input class="btn btn-primary" type="submit" value="Submit" />
            <input type="button" class="btn btn-info" value="Return" onclick="javascript:history.go(-1)" />
        </div>
    </div>
</form>

<br />

@section scripts
{
    <script>
        $(document).ready(function () {
            $('#form').bootstrapValidator();

        });
    </script>
}
